// asyncPackageComponent/cloud_shop_plugin/cloud_shop_template/cloud_shop_template.js
const app = getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    otherInfo: {
      type: null,
      value: ''
    },
    is_shop_owner: {
      type: null,
      value: false
    },
    cloud_shop_plugin_list: {
      type: null,
      value: []
    }
  },
  lifetimes: {
    attached() {
      this.setData({
        cloud_basic_info: wx.getStorageSync('yz_basic_info').plugin_setting.cloud_shop
      })
    }
  },
  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    pluginGoto(e) {
      let {
        item
      } = e.currentTarget.dataset;
      if(item.name == 'm-erweima'){
        this.triggerEvent('openQrCode')
        return
      }
      if (!item.mini_url) return
      wx.navigateTo({
        url: item.mini_url,
        fail: function (err) {
          app.tips(err)
        }
      })
    },
    toCustomersMy() {
      wx.navigateTo({
        url: '/mircoApp/cloud_shop/customersMy/customersMy',
      })
    },
    to_cloud_shop_reward_center() {
      wx.navigateTo({
        url: '/mircoApp/cloud_shop/cloud_shop_reward_center/cloud_shop_reward_center',
      })
    },
    to_mysales(){
      wx.navigateTo({
        url: '/mircoApp/cloud_shop/mysales/mysales',
      })
    },
    to_reward(){
      wx.navigateTo({
        url: '/mircoApp/shop_base/reward_template/index?api=plugin.cloud-shop.frontend.reward.index&date_time=1',
      })
    },
    tosales() {
      wx.navigateTo({
        url: '/mircoApp/cloud_shop/brandSales/brandSales',
      })
    }
  }
})